0VERSION = 3.00)MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0 distinct_values_comboPixelsClass1comboboxdistinct_values_combo)MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0 vcrPixelsClass7controlvcr nG%!N0U%C &FC%C,Are you sure you want to delete this record?$x %C+  H%C+C  H UTHISPARENTCNAVIGATION_TABLETHISFORMREFRESHClick,1eA1AA1AA1)zTop = 1 Left = 144 Height = 27 Width = 24 Picture = ..\graphics\delete.bmp Caption = "" Name = "Vfpcommandbutton2" vcr vfp_base.vcx1PROCEDURE Init #DEFINE NO_TABLE_LOC "The table alias must be specified in the controlSource property, in the format 'alias.column'." IF !EMPTY(THIS.controlSource) THEN IF NOT "." $ THIS.controlSource THEN =MESSAGEBOX(NO_TABLE_LOC) ELSE cAlias = LEFTC(THIS.controlSource,(ATC(".",THIS.controlSource)-1)) cColumn = RIGHTC(THIS.controlSource,(LENC(THIS.controlSource)-ATC(".",THIS.controlSource))) THIS.rowSourceType = 3 cSQL = "SELECT DISTINCT " + cColumn + " FROM " + cAlias + ; " INTO CURSOR c" + THIS.name THIS.rowSource = cSQL ENDIF ENDIF ENDPROC PROCEDURE Destroy cCursor = "c" + THIS.name IF USED(cCursor) THEN USE IN &cCursor ENDIF ENDPROC dHeight = 21 FontName = "MS Sans Serif" FontSize = 8 Width = 106 Name = "distinct_values_combo" combobox)MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0  lookup_comboPixelsClasscombobox lookup_combocomboboxVfpcommandbutton2 commandbuttonvfpcommandbuttonvcrVfpcommandbutton1vcrjdisplay_column Specifies the column from lookup_table to display in the drop down list. lookup_table Specifies the table to lookup the values to display in the drop down. return_column Specifies the column value to return the value property of the combo box. order_column Specifies the column to order the records displayed in the drop down list (optional). PROCEDURE Click #DEFINE MSGBOX_YES 6 #DEFINE C_MSGBOX1 36 #DEFINE C_DELETE_LOC "Are you sure you want to delete this record?" IF !EMPTY(THIS.parent.cNavigation_table) THEN SELECT (THIS.parent.cNavigation_table) ENDIF IF MESSAGEBOX(C_DELETE_LOC,C_MSGBOX1) = MSGBOX_YES DELETE IF !EOF() SKIP 1 ENDIF IF EOF() AND !BOF() SKIP -1 ENDIF THISFORM.Refresh ENDIF ENDPROC 5 Ƶ%UD%C &F C UTHISPARENTCNAVIGATION_TABLETHISFORM ADDNEWRECORDREFRESHClick,1aA1)PROCEDURE Click IF !EMPTY(THIS.parent.cNavigation_table) THEN SELECT (THIS.parent.cNavigation_table) ENDIF THISFORM.AddNewRecord() THISFORM.Refresh ENDPROC Top = 1 Left = 111 Height = 27 Width = 24 Picture = ..\graphics\add.bmp DisabledPicture = ..\graphics\adddis.bmp Caption = "" Name = "Vfpcommandbutton1"  commandbutton vfp_base.vcxvfpcommandbutton4 #% UM%C &F %C+ <#6 UTHISPARENTCNAVIGATION_TABLETHISFORMREFRESHClick,1aAQA1)PROCEDURE Click IF !EMPTY(THIS.parent.cNavigation_table) THEN SELECT (THIS.parent.cNavigation_table) ENDIF * If at not at end-of-file, go to last record in table IF !EOF() THEN GO BOTTOM ENDIF * Refresh the form THISFORM.Refresh ENDPROC  cmdBottom commandbutton vfp_base.vcxvfpcommandbuttonPROCEDURE Destroy cAlias = THIS.name IF USED(cAlias) THEN USE IN &cAlias ENDIF ENDPROC PROCEDURE Error LPARAMETERS nError, cMethod, nLine #DEFINE INVALID_COLUMN_LOC "An invalid display column or return column has been specified in the 'display_column' or 'return_column' properties (combo box " + THIS.name + ")." #DEFINE INVALID_TABLE_LOC "An invalid table has been specified in the 'display_column' or 'lookup_table' property (combo box " + THIS.name + ")." #DEFINE INVALID_SORT_LOC "An invalid column has been specified in the 'order_column' property (combo box " + THIS.name + ")." DO CASE CASE nError = 1806 =MESSAGEBOX(INVALID_COLUMN_LOC,48) CASE nError = 1808 =MESSAGEBOX(INVALID_SORT_LOC,48) CASE nError = 1802 =MESSAGEBOX(INVALID_TABLE_LOC,48) OTHERWISE =MESSAGEBOX(MESSAGE(),48) ENDCASE ENDPROC PROCEDURE Init #DEFINE NO_LOOKUP_TABLE_LOC "A lookup table must be specified in the 'lookup_table' property (combo box " + THIS.name + ")." #DEFINE NO_DISPLAY_COLUMN_LOC "A display column must be specified in the 'display_column' property (combo box " + THIS.name + ")." #DEFINE NO_RETURN_COLUMN_LOC "A return column must be specified in the 'return_column' property (combo box " + THIS.name + ")." lOK = .T. DO CASE CASE EMPTY(THIS.lookup_table) =MESSAGEBOX(NO_LOOKUP_TABLE_LOC,48) lOK = .F. CASE EMPTY(THIS.display_column) =MESSAGEBOX(NO_DISPLAY_COLUMN_LOC,48) lOK = .F. CASE EMPTY(THIS.return_column) =MESSAGEBOX(NO_RETURN_COLUMN_LOC,48) lOK = .F. ENDCASE IF lOK THEN IF !EMPTY(THIS.order_column) nSQL = "SELECT " + THIS.display_column + "," + ; THIS.return_column + " FROM " + THIS.lookup_table + ; " ORDER BY " + THIS.order_column + " INTO CURSOR " + THIS.name ELSE nSQL = "SELECT " + THIS.display_column + "," + ; THIS.return_column + " FROM " + THIS.lookup_table + ; " INTO CURSOR " + THIS.name ENDIF THIS.RowSourceType = 3 THIS.RowSource = nSQL THIS.BoundColumn = 2 ENDIF THIS.Refresh ENDPROC Top = 1 Left = 86 Height = 27 Width = 24 Picture = ..\graphics\bottom.bmp DisabledPicture = ..\graphics\bottom_dis.bmp Caption = "" Name = "cmdBottom" H //% U]%C &F %C+;#)L H UTHISPARENTCNAVIGATION_TABLETHISFORMREFRESHClick,1aAQA1E)/PPROCEDURE Click IF !EMPTY(THIS.parent.cNavigation_table) THEN SELECT (THIS.parent.cNavigation_table) ENDIF * If table pointer is at the end-of-table, then * rollover to the first record in the table IF EOF() THEN GO TOP ELSE * Otherwise, go to next record SKIP 1 ENDIF * Refresh the form THISFORM.Refresh ENDPROC Top = 1 Left = 62 Height = 27 Width = 24 Picture = ..\graphics\next.bmp DisabledPicture = ..\graphics\nextdis.bmp Caption = "" Name = "cmdNext" vcrcmdNext commandbutton vfp_base.vcxvfpcommandbuttonTop = 1 Left = 25 Height = 27 Width = 24 Picture = ..\graphics\prior.bmp DisabledPicture = ..\graphics\priordis.bmp Caption = "" Name = "cmdPrevious" vcrHeight = 21 FontName = "MS Sans Serif" FontSize = 8 Width = 106 display_column = lookup_table = return_column = order_column = Name = "lookup_combo" I 005% U^%C &F %C;#6M H UTHISPARENTCNAVIGATION_TABLETHISFORMREFRESHClick,1aAQA1R)0]PROCEDURE Click IF !EMPTY(THIS.parent.cNavigation_table) THEN SELECT (THIS.parent.cNavigation_table) ENDIF * If table pointer is at the beginning-of-table, then * rollover to the last record in the table IF BOF() THEN GO BOTTOM ELSE * Otherwise, go to previous record SKIP -1 ENDIF * Refresh the form THISFORM.Refresh ENDPROC  cmdPrevious commandbutton vfp_base.vcxvfpcommandbutton4 #% UM%C &F %C+ <#) UTHISPARENTCNAVIGATION_TABLETHISFORMREFRESHClick,1aAQA1)PROCEDURE Click IF !EMPTY(THIS.parent.cNavigation_table) THEN SELECT (THIS.parent.cNavigation_table) ENDIF * If at not at the beginnng-of-file, go to first record in table IF !EOF() THEN GO TOP ENDIF * Refresh the form THISFORM.Refresh ENDPROC Top = 1 Left = 1 Height = 27 Width = 24 Picture = ..\graphics\top.bmp DisabledPicture = ..\graphics\top_dis.bmp Caption = "" Name = "cmdTop" vcrcmdTop commandbutton vfp_base.vcxvfpcommandbuttonZcnavigation_table Specifies the table to navigate in. If blank, uses the current table. control UE%o*U8T%C1USE IN &cAlias UCALIASTHISNAME H CAn invalid display column or return column has been specified in the 'display_column' or 'return_column' properties (combo box ).0x FkCOAn invalid column has been specified in the 'order_column' property (combo box ).0x  ~CbAn invalid table has been specified in the 'display_column' or 'lookup_table' property (combo box ).0x2CCE0xUNERRORCMETHODNLINETHISNAME Ta H CgCKA lookup table must be specified in the 'lookup_table' property (combo box ).0x T- C$kCOA display column must be specified in the 'display_column' property (combo box ).0x T- CiCMA return column must be specified in the 'return_column' property (combo box ).0x T- %%C 3eTSELECT , FROM  ORDER BY  INTO CURSOR PTSELECT , FROM  INTO CURSOR TT T   U LOKTHIS LOOKUP_TABLENAMEDISPLAY_COLUMN RETURN_COLUMN ORDER_COLUMNNSQL ROWSOURCETYPE ROWSOURCE BOUNDCOLUMNREFRESHDestroy,Error|Init1!A2! !!A2!q!!A1SAA1SoE`) (%/rNU\%C U%. jC^The table alias must be specified in the controlSource property, in the format 'alias.column'.xQ$TCC.*TCCC.THTSELECT DISTINCT  FROM  INTO CURSOR cTUTHIS CONTROLSOURCECALIASCCOLUMN ROWSOURCETYPECSQLNAME ROWSOURCE>Tc%C7USE IN &cCursor UCCURSORTHISNAMEInit,Destroy13aAAA3Q1A1A _)Width = 168 Height = 28 Picture = ..\graphics\picbttns.bmp BackStyle = 0 BorderWidth = 0 cnavigation_table = Name = "vcr"